﻿using System;

namespace Shell.Common
{
    public static class Guard
    {
        public static void NotNull<T>(this T value) where T : class
        {
            if (value == null)
            {
                throw new ArgumentNullException();
            }
        }

        public static void IsTrue(this bool value)
        {
            if (value == false)
            {
                throw new Exception("Invariant fail.");
            }
        }
    }
}
